import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpRefundAddress {
  id!: number;
  uniacid!: number;
  name!: string;
  phone!: string;
  addressId!: string;
  detail!: unknown;
  note?: unknown;
  isDefault: boolean = true;
  addTime!: string;
  updateTime!: string;
}

export const ImsYzdKpRefundAddressSchema = new EntitySchema({
  class: ImsYzdKpRefundAddress,
  properties: {
    id: { primary: true, type: 'number' },
    uniacid: { type: 'number', index: 'uniacid' },
    name: { type: 'string', length: 255 },
    phone: { type: 'string', length: 255 },
    addressId: { type: 'string', length: 255 },
    detail: { type: 'unknown', columnType: 'longtext' },
    note: { type: 'unknown', columnType: 'longtext', nullable: true },
    isDefault: { type: 'boolean', default: true, index: 'is_default' },
    addTime: { type: 'string', length: 255 },
    updateTime: { type: 'string', length: 255 },
  },
});
